home *** CD-ROM | disk | FTP | other *** search
- Path: inforamp.net!ts9-03
- From: rmorin@inforamp.net (Randy Charles Morin)
- Newsgroups: comp.lang.c++
- Subject: Re: question assignment operator in c++
- Date: Thu, 07 Mar 96 06:05:00 GMT
- Organization: MiddleWorld SoftWare
- Message-ID: <4hlua6$6jg@sam.inforamp.net>
- References: <menghua_wang.1.002DB7BE@muccmail.missouri.edu>
- NNTP-Posting-Host: ts9-03.tor.inforamp.net
- X-Newsreader: News Xpress Version 1.0 Beta #4
-
- In article <menghua_wang.1.002DB7BE@muccmail.missouri.edu>,
- menghua_wang@muccmail.missouri.edu (menghua wang) wrote:
- >Why does not the following frind overloading work?
- > mycalss operator= (myclass &A, myclass &B) {
- > A.i = B.i;
- > return A;
- > }
-
- Because, your example returns one myclass as the return value and one as a
- referenced class. This is redundant. When the guys put C++ together they
- decided that redundancy was not a feature they need for this function.
-
- Agrivar
-